package com.yejiali.backend.common.httpcode;

/**
 * @Author:yejiali
 * @Date:2025/5/11-05-11-15:48
 * @Decsription:com.yejiali.backend.common.httpcode
 * @Version:1.0
 */
public enum HttpCodeEnum {
    // 成功
    SUCCESS(200,"操作成功"),
    // 登录
    NEED_LOGIN(401,"需要登录后操作"),
    NO_OPERATOR_AUTH(403,"无权限操作"),
    SYSTEM_ERROR(500,"出现错误"),
    REQUIRE_USERNAME(504, "必需填写用户名"),
    PASSWORD_NOT_NULL(508,"密码不能为空" ),
    LOGIN_ERROR(505,"用户名或密码错误"),
    // Token无效
    INVALID_TOKEN(506, "Token无效"),
    // 用户不存在
    USER_NOT_FOUND(507, "用户不存在"),
    // 用户已存在
    USER_ALREADY_EXISTS(508, "用户已存在"),
    //病人不存在
    PATIENT_NOT_FOUND(509, "病人不存在"),
    // 未找到
    CASES_NOT_FOUND(404, "未找到该病例"),
    PATIENT_EXIST(301,"该患者已存在" ),
    PATIENT_ADD_ERROR(501,"病人存档失败" ),
    //文件类型不允许
    FILE_TYPE_NOT_ALLOWED(502, "文件类型不允许"),
    // 文件上传失败
    FILE_UPLOAD_FAILED(503, "文件上传失败"),
    //证件识别失败
    CARD_RECOGNITION_FAILED(504, "证件识别失败"),
    HOSPITAL_EXIST(505,"合作医院已存在" ),
    HOSPITAL_NOT_EXIST(506,"未找到合作医院" );


    int code;
    String msg;
    HttpCodeEnum(int code, String errorMessage){
        this.code = code;
        this.msg = errorMessage;
    }
    public int getCode() {
        return code;
    }
    public String getMsg() {
        return msg;
    }
}

